<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h1 v-on:click="addNum">{{num}}</h1>
<!-- 用 @ 代替 v-on -->
      <h1 @click="addNum">使用@代替v-on：{{num}}</h1>
      <hr>
    <h2 @click="handler('weigegood!!')">{{msg}}</h2>

  </div>
  <script src="./vue.js"></script>
  <script>
    new Vue({
      el:'#app',
      data:{
          num:10,
          msg:"vue msg: hello word!"
      },
      methods:{
        addNum() {
            this.num +=  100
        },
        handler(data) {

            alert(data)
            this.msg = this.msg + ' ' +data
        }
      }
     });
  </script>
</body>
</html>
